<?php
class BaseAction extends Action
{
	function _initialize()
	{

	}
	
	protected function getPage($count, $pageSize = 15)
	{
		return new Page ($count, $pageSize);
	}
	
	/**
	 * 获取年
	 * @param int $month
	 */
	public function getYears($year = 0)
	{
		$year = 2012;
		$years = array();
		for ($i = date('Y'); $i >= $year; $i--) {
			$years[] = array('year' => $i, 'isNow' => ($i == $year));
		}
		return $years;
	}
	
	/**
	 * 获取月份
	 * @param int $month
	 */
	public function getMonths($month = 0)
	{
		if (empty($month)) {
			$month = date('n'); // n 数字表示的月份，没有前导零1 到 12
		}
		$months = array();
		for ($i = 1; $i <= 12; $i++) {
			$months[] = array('month' => $i, 'isNow' => ($i == $month));
		}
		return $months;
	}
}

?>